home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lantools / blueprnt / bpcomdef.asm < prev    next >
Assembly Source File  |  1989-09-27  |  3KB  |  105 lines

  1. ;************************************************************
  2. ;* BP-LAN Remote Modem Installation Utility  (BPCOMDEF.ASM) *
  3. ;* by Craig Chaiken                                         *
  4. ;* August 20, 1989                                          *
  5. ;*                                                          *
  6. ;* Function: Installs Remote Network Printer                *
  7. ;*                                                          *
  8. ;* Command Format:                                          *
  9. ;*     BPCOMDEF /socket_num /local_modem /remote_modem      *
  10. ;************************************************************
  11. ;
  12. codeseg segment
  13.         assume  cs:codeseg,ds:codeseg,es:codeseg
  14.         org     100h
  15.  
  16. start:  jmp     intinst
  17.         include bpbioshd.mod
  18.  
  19. ;*** Variables ***
  20. ;
  21. old_int14h_vector  label   dword
  22. old_int14h_offs dw      ?
  23. old_int14h_seg  dw      ?
  24. socket_num      db      0
  25. local_printer   db      0
  26. remote_printer  db      0
  27. packet_buffer   db      6 dup (0)
  28.  
  29. ;*****************************
  30. ;*** New Interrupt Handler ***
  31. ;*****************************
  32. new_int14h      proc    far
  33.         cmp     dl,cs:local_printer
  34.         jz      new_i1
  35.         jmp     cs:old_int14h_vector
  36. new_i1: pushf
  37.         push    bx
  38.         push    cx
  39.         push    dx
  40.         push    si
  41.         push    di
  42.         push    ds
  43.         push    es
  44.  
  45.         push    cs              ;Copy CS into DS
  46.         pop     ds
  47.         mov     packet_buffer,'S'
  48.         mov     packet_buffer+1,ah
  49.         mov     ah,remote_printer
  50.         mov     packet_buffer+2,ah
  51.         mov     packet_buffer+3,al
  52.         put_packet      socket_num,4,offset packet_buffer
  53.         get_packet      socket_num,cx,offset packet_buffer
  54.         mov     ah,packet_buffer
  55.         mov     al,packet_buffer+1
  56. new_p1: pop     es
  57.         pop     ds
  58.         pop     di
  59.         pop     si
  60.         pop     dx
  61.         pop     cx
  62.         pop     bx
  63.         popf
  64.         iret
  65. new_int14h      endp
  66.  
  67. ;*************************************
  68. ;*** Install New Interrupt Handler ***
  69. ;*************************************
  70. intinst proc    near
  71.         mov     al,cs:[80h]
  72.         or      al,al
  73.         jz      default
  74.         mov     si,81h
  75.         call    get_opt ;get socket_num
  76.         jb      default
  77.         mov     socket_num,cl
  78.         call    get_opt ;get local printer number
  79.         jb      default
  80.         mov     local_printer,cl
  81.         call    get_opt ;get remote printer number
  82.         jb      default
  83.         mov     remote_printer,cl
  84. default: mov    ah,35h          ; get interrupt vector function
  85.         mov     al,14h
  86.         int     21h
  87.         mov     old_int14h_offs,bx ; save old interrupt
  88.         mov     old_int14h_seg,es       ;   address
  89.         mov     ah,25h                  ; set interrupt vector function
  90.         mov     al,14h
  91.         mov     dx,offset new_int14h    ; point to new routine
  92.         int     21h
  93.         lea     dx,intinst
  94.         int     27h
  95. intinst endp
  96.  
  97.         include misc.mod
  98.  
  99. codeseg ends
  100.         end     start
  101.  
  102. ;************************************************************
  103. ;* End of Interrupt Handler Installation Module             *
  104. ;************************************************************
  105.